3.1.16 \(\int \frac {\sec ^2(x)}{a+b \cot (x)} \, dx\) [16]

Optimal. Leaf size=29 \[ -\frac {b \log (a+b \cot (x))}{a^2}-\frac {b \log (\tan (x))}{a^2}+\frac {\tan (x)}{a} \]

[Out]

-b*ln(a+b*cot(x))/a^2-b*ln(tan(x))/a^2+tan(x)/a

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3597, 46} \begin {gather*} -\frac {b \log (\tan (x))}{a^2}-\frac {b \log (a+b \cot (x))}{a^2}+\frac {\tan (x)}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[x]^2/(a + b*Cot[x]),x]

[Out]

-((b*Log[a + b*Cot[x]])/a^2) - (b*Log[Tan[x]])/a^2 + Tan[x]/a

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 3597

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps

\begin {align*} \int \frac {\sec ^2(x)}{a+b \cot (x)} \, dx &=-\left (b \text {Subst}\left (\int \frac {1}{x^2 (a+x)} \, dx,x,b \cot (x)\right )\right )\\ &=-\left (b \text {Subst}\left (\int \left (\frac {1}{a x^2}-\frac {1}{a^2 x}+\frac {1}{a^2 (a+x)}\right ) \, dx,x,b \cot (x)\right )\right )\\ &=-\frac {b \log (a+b \cot (x))}{a^2}-\frac {b \log (\tan (x))}{a^2}+\frac {\tan (x)}{a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 27, normalized size = 0.93 \begin {gather*} \frac {b \log (\cos (x))-b \log (b \cos (x)+a \sin (x))+a \tan (x)}{a^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^2/(a + b*Cot[x]),x]

[Out]

(b*Log[Cos[x]] - b*Log[b*Cos[x] + a*Sin[x]] + a*Tan[x])/a^2

________________________________________________________________________________________

Maple [A]
time = 0.29, size = 21, normalized size = 0.72

method result size
default \(\frac {\tan \left (x \right )}{a}-\frac {b \ln \left (a \tan \left (x \right )+b \right )}{a^{2}}\) \(21\)
risch \(\frac {2 i}{a \left ({\mathrm e}^{2 i x}+1\right )}+\frac {b \ln \left ({\mathrm e}^{2 i x}+1\right )}{a^{2}}-\frac {b \ln \left ({\mathrm e}^{2 i x}+\frac {i b -a}{i b +a}\right )}{a^{2}}\) \(60\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2/(a+b*cot(x)),x,method=_RETURNVERBOSE)

[Out]

tan(x)/a-b/a^2*ln(a*tan(x)+b)

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 20, normalized size = 0.69 \begin {gather*} -\frac {b \log \left (a \tan \left (x\right ) + b\right )}{a^{2}} + \frac {\tan \left (x\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*cot(x)),x, algorithm="maxima")

[Out]

-b*log(a*tan(x) + b)/a^2 + tan(x)/a

________________________________________________________________________________________

Fricas [A]
time = 3.13, size = 57, normalized size = 1.97 \begin {gather*} -\frac {b \cos \left (x\right ) \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}\right ) - b \cos \left (x\right ) \log \left (\cos \left (x\right )^{2}\right ) - 2 \, a \sin \left (x\right )}{2 \, a^{2} \cos \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*cot(x)),x, algorithm="fricas")

[Out]

-1/2*(b*cos(x)*log(2*a*b*cos(x)*sin(x) - (a^2 - b^2)*cos(x)^2 + a^2) - b*cos(x)*log(cos(x)^2) - 2*a*sin(x))/(a
^2*cos(x))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{2}{\left (x \right )}}{a + b \cot {\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**2/(a+b*cot(x)),x)

[Out]

Integral(sec(x)**2/(a + b*cot(x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 21, normalized size = 0.72 \begin {gather*} -\frac {b \log \left ({\left | a \tan \left (x\right ) + b \right |}\right )}{a^{2}} + \frac {\tan \left (x\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*cot(x)),x, algorithm="giac")

[Out]

-b*log(abs(a*tan(x) + b))/a^2 + tan(x)/a

________________________________________________________________________________________

Mupad [B]
time = 0.20, size = 20, normalized size = 0.69 \begin {gather*} \frac {\mathrm {tan}\left (x\right )}{a}-\frac {b\,\ln \left (b+a\,\mathrm {tan}\left (x\right )\right )}{a^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x)^2*(a + b*cot(x))),x)

[Out]

tan(x)/a - (b*log(b + a*tan(x)))/a^2

________________________________________________________________________________________